#include "noeditdelegate.h"

NoEditDelegate::NoEditDelegate(QObject *parent)
    : QItemDelegate(parent)
{

}

QWidget *NoEditDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
    if (index.column() == 0) {
        return nullptr;  // 不为第一列创建编辑器，禁用编辑
    }
    return QItemDelegate::createEditor(parent, option, index);  // 默认编辑器
}
